<?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');

class CprojectControllerNewCproject extends JControllerForm {

    function save() {
        global $mainframe;
        $post = JRequest::get('post');
        $post['alias'] = CprojectHelper::alias($post['name']);
       // echo $post['alias'];
       // print_r($post); die();
        JTable::addIncludePath(JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_cproject' . DS . 'tables');
        $row = & JTable::getInstance('Cproject', 'Table');
        if (!$row->bind($post)) {
            JError::raiseError(500, $row->getError());
        }
        if (!$row->store()) {
            JError::raiseError(500, $row->getError());
        }
        $this->setRedirect('index.php?option=com_cproject&view=sections', '');
     //   return '';
    }
    
}

?>